<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>模板详情</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<script type="text/javascript" src="../../static/js/WdatePicker/WdatePicker.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
	String para =request.getParameter("f_cc_id");
	int f_cc_id = 0;
	if(para != null)
		f_cc_id = Integer.valueOf(para);
	String myIp = session.getServletContext().getInitParameter("img_url");
	String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
var loadFlag=0;
var review=0;
	$(function() {
		var f_cc_id = <%=f_cc_id%>;
		$("#f_cc_id").val(f_cc_id);
		//获取模板信息
		$.ajax({
			url:"../../content/select_content.do?f_cc_id="+f_cc_id,
			success:function(data) {
				data = JSON.parse(data);
				$("#f_cc_name").html(data.f_cc_name);
				$("#f_cc_name_").val(data.f_cc_name);
				$("#f_cc_companyname").html(data.f_cc_companyname);
				 var arrstr=data.f_cc_obligate1;
				 var str_="";
				 if(arrstr&&arrstr.length>0){
					arrstr=arrstr.substring(1,arrstr.length-1);
					var arrlist=arrstr.split(",");
					
					for(var i=0;i<arrlist.length;i++){
						if(!(arrlist[i].indexOf("http://www.w3.org")>=0||"http://www.w3.org".indexOf(arrlist[i])>=0)){ //不包含w3页面
							 str_+=arrlist[i]+"<br/>";
						}
						
					}
				 }
				$("#outer_chain").html(str_);
				if(str_!=''&&str_.length>0){
					review=1;
				}
				var status = "未知";
				switch(data.f_cc_end){
				case 1:
					status="百视通政企标清";
					break;
				case 2:
					status="百视通酒店高清";
					break;
				case 3:
					status="百视通温台酒店高清";
					break;
				case 4:
					status="百视通政企高清";
					break;
				case 5:
					status="百视通温台政企高清";
					break;
				case 6:
					status="广电酒店标清";
					break;
				case 7:
					status="广电酒店高清";
					break;
				case 8:
					status="中兴百视通公众";
					break;
				case 9:
					status="中兴百视通酒店";
					break;
				case 10:
					status="中兴广电标清";
					break;
				case 11:
					status="中兴广电高清";
					break;
				case 12:
					status="广电公众";
					break;
				case 13:
					status="广电公众高清";
					break;
				case 14:
					status="中兴广电高清";
					break;
				}
				$("#f_cc_end").html(status);
				if(data.f_cc_isfree==1){
					$("#isfree").html("个性");
				}else{
					$("#isfree").html("通用");
				}
				
				if(data.f_cc_status==2||data.f_cc_status==4){
					$("#radio1").val(16);
				}
				if(data.f_cc_status==16||data.f_cc_status==13){
					$("#radio1").val(1);
					$("#radio2").val(13);
				}
				$("#f_cc_desc").html(data.f_cc_desc);
				if(data.f_cc_status==4||data.f_cc_status==13){
					$("#f_cc_remark").html(data.f_cc_remark);
				}
				loadFlag=1;
			}
		});
		//获取模板绑定的分类信息
		$.ajax({
			url:'../../content/select_contentBindCatalog.do?f_cc_id='+f_cc_id,
			success:function(data){
				data = JSON.parse(data);
				var str = "";
				for(var i=0;i<data.length;i++) {
					str+=data[i].f_catalog_name+",";
				}
				if(!str=="")
					str =str.substring(0, str.length-1);
				$("#bindCatalog").html(str);
			}
		});
	});

	function _submitFm() {
		if(loadFlag==0){
			return;
		}
		if(loadFlag==1&&review==1&&$("#radio1").is(":checked")){
			alert("存在外链地址,无法通过审核！");
			return;
		}
		app_ajax('../../content/review_content.do', $("#contentForm").serialize(), function(data) {
			if (data.success) {
				$.messager.progress('close');
				$.messager.alert('提示', '审核成功！', 'info', function() {
					parent.$('#dlg').dialog('close');
					parent.gotoSearch($('#easyui-treegrid'));
				});
			} else {
				$.messager.alert('提示', data.result, 'info', function() {
					$.messager.progress('close');
				});
			}
	});
	}
	
	function playVideo(url){
		var win=window.open("", "newwindow", "height=500, width=870, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no");
		win.document.body.innerHTML='<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" Name="MediaPlayer" src="'+url+'" HEIGHT="100%" WIDTH="100%" ShowControls="1" ShowPositionControls="1" ShowAudioControls="1" ShowTracker="0" ShowDisplay="1" ShowStatusBar="0" ShowGoToBar="0" ShowCaptioning="0" AutoStart="1" AutoRewind="0" AnimationAtStart="0" TransparentAtStart="0" AllowChangeDisplaySize="0" AllowScan="0" EnableContextMenu="1" ClickToPlay="1"></embed>';
	}
	
</script>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：模板管理 &gt; 模板审核</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input type="hidden" id="f_cc_id" name="f_cc_id" value="" />
					<input type="hidden" id="f_cc_name_" name="f_cc_name" value="" />
					<input type="hidden" id="sourceFlag" name="sourceFlag" value="5"/>
					<legend>模板审核</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>模板名称:
									</td>
									<td width="30%">
										<font id="f_cc_name" style="width: 150px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>组织选择:
									</td>
									<td width="30%">
										<font id="f_cc_companyname" style="width: 150px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>路径:
									</td>
									<td width="30%">
										<font id="f_cc_desc" style="width: 150px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
				
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										&nbsp;模板类型:
									</td>
									<td width="30%">
										<font id="f_cc_end" style="width: 150px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					
					
					<fieldset class="hide-item">
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										是否通用:
									</td>
									<td width="30%">
										<font id="isfree" style="width: 150px;"></font>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
				
					<fieldset id="videoFieldSet" style="display: none;">
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										播放视频:
										<button type="button" id="playVideoBtn">播放</button>									
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="10%" align="left">
										<jsp:include page="../../pictures/pictures_info_industry.jsp" flush="true">
											<jsp:param value="模板" name="picType"/>
											<jsp:param value="<%=f_cc_id %>" name="f_cp_relationid"/>
										</jsp:include>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">外链列表:</td>
									<td width="30%" id="outer_chain">
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">审核备注:</td>
									<td width="30%" >
										<textarea id="f_cc_remark" name="f_cc_remark" rows="3" cols="30"></textarea>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">视频审核:</td>
									<td width="30%" >
										<input type="radio" id="radio1" checked="true" name="f_cc_status" value="1">上线</input>
										<input type="radio" id="radio2" name="f_cc_status" value="4">审核不通过</input>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
					<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
				</form>
			</div>
			<div class="toolbar" style="text-align: center;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
					href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
					href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
					class="easyui-linkbutton"
					onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
			</div>
		</div>
		<!--主体 结束-->
	</div>
</html>
